package Sources;

import Users.User;
import java.util.ArrayList;

/**
 * @author Myhaylo Kotsyuruba
 * @version v.1.4   14.03.13
 */

public class SourceUser {
    private ArrayList<User> users;

    public SourceUser() {
        users = new ArrayList<User>();
    }

    public User getUser(String userName) {
        for (User user : users) {
            if(user.getName().equalsIgnoreCase(userName)) {
                return user;
            }
        }
        User newUser = new User(userName);
        users.add(newUser);
        return newUser;
    }
}
